package com.qingcheng.consumer;


import com.qingcheng.service.page.PageService;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageListener;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 监听创建商品详情
 * 如果创建了商品详情 就从rabbitmq中获取json数据并解析
 */
public class DelPageMessageConsumer implements MessageListener {

    @Autowired
    private PageService pageService;

    @Override
    public void onMessage(Message message) {
        String spuId = new String(message.getBody());
        pageService.delPage(spuId);
    }
}
